<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE HTML >
<html>
<head>
	<title>项目管理系统</title>
	<link rel="stylesheet" type="text/css" href="static/css/bootstrap.min.css">
	<link rel="stylesheet" type="text/css" href="static/js/select2/select2.css">
	<style type="text/css">
		body{
			padding-top:60px;
			background-image:url(static/img/bg.png);
		}
	</style>
	
</head>
<body>
	
	<div class="navbar navbar-fixed-top">
		<div class="navbar-inner">
			<div class="container">
				<a class="brand" href="#">Kaishengit PMS</a>
			</div>
		</div>
	</div>
	
	
	<div class="container">
	  <div class="row">
		<div class="span9">
			<form action="project.jspx" id="myform" method="post" class="form-horizontal">
		        <fieldset>
		          <legend>开始一个新项目</legend>
		          <div class="control-group">
		            <label class="control-label" for="input01">项目名称</label>
		            <div class="controls">
		              <input name="name" class="span5" id="input01"  type="text">
		            </div>
		          </div>
		          <div class="control-group">
		            <label class="control-label" for="input01">项目描述</label>
		            <div class="controls">
		              <textarea name="describe" class="span5" rows="4"></textarea>
		            </div>
		          </div>
		          <div class="control-group">
		            <label class="control-label" for="multiSelect">负责人</label>
		            <div class="controls">
		              <select name="manager" id="manager" class="multiSelect" style="width:160px">
		                <option selected="selected"></option>
		                <c:forEach items="${userList }" var="user">
		                	<option value="${user.id }">${user.name }</option>
		                </c:forEach>
		              </select>
		            </div>
		          </div>
		         <input type="hidden" name="members" id="members"/>
		         <div class="control-group">
		            <label class="control-label" for="multiSelect">项目成员</label>
		            <div class="controls">
		              <select name="member" id="member"  multiple class="multiSelect" style="width:300px">
		                <c:forEach items="${userList }" var="user">
		                	<option value="${user.id }">${user.name }</option>
		                </c:forEach> 
		              </select>
		            </div>
		          </div>
	          
		          <div class="form-actions">
		            <button type="button" id="btnSave" class="btn btn-primary">保存</button>
		            <a class="btn" href="project.jspx">返回</a>
		           
		            <!-- 
					    <button class="btn" onclick="location.back()">返回</button>         
					            返回按钮不可用，点击后，插入空项目
					             -->
		          </div>
	       	 	</fieldset>
     	 	</form>          
		</div>
	  </div>
	</div>
	
	<script type="text/javascript" src="static/js/jquery.js"></script>
	<script type="text/javascript" src="static/js/select2/select2.min.js"></script>
	<script type="text/javascript">
		$(document).ready(function(){
			$(".multiSelect").select2();
			
			$("#btnSave").click(function(){
				var v = $("#member").select2("val");
				$("#members").val(v);
				$("#myform").submit();
			});
		});
	
	</script>
</body>
</html>